package com.cn;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
import org.junit.jupiter.params.provider.CsvSource;

class TriangleTest {
    @ParameterizedTest
    @CsvSource({
            "1,2,3,非三角形",
            "-1,2,3,输入错误"
    })
    void testWithCsvSource(int a,int b,int c,String expected) {
        Triangle triangle = new Triangle();
        assertEquals(expected, triangle.classify(a,b,c));
    }
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle.csv")//一般边界值分析
    void test_csv_file_source(int a, int b, int c, String expected) {
        Triangle triangle = new Triangle();
        assertEquals(expected, triangle.classify(a,b,c));
    }
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle1.csv")//健壮边界值分析
    void test_csv_file_source1(int a, int b, int c, String expected) {
        Triangle triangle = new Triangle();
        assertEquals(expected, triangle.classify(a,b,c));
    }
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle3.csv")//最坏一般边界值分析
    void test_csv_file_source2(int a, int b, int c, String expected) {
        Triangle triangle = new Triangle();
        assertEquals(expected, triangle.classify(a,b,c));
    }
    @ParameterizedTest
    @CsvFileSource(resources = "/triangle4.csv")//最坏健壮边界值分析
    void test_csv_file_source3(int a, int b, int c, String expected) {
        Triangle triangle = new Triangle();
        assertEquals(expected, triangle.classify(a,b,c));
    }
}